package errorx

import (
	"github.com/zeromicro/x/errors"
)

var (
	ErrRegisterDisabled       = errors.New(10001, "注册功能已关闭")
	ErrUsernameExists         = errors.New(10002, "用户名已存在")
	ErrEmailExists            = errors.New(10003, "邮箱已存在")
	ErrPhoneExists            = errors.New(10004, "手机号已存在")
	ErrUserNotFound           = errors.New(10005, "用户不存在")
	ErrInvalidPassword        = errors.New(10006, "密码错误")
	ErrInvalidToken           = errors.New(10007, "无效的token")
	ErrTokenExpired           = errors.New(10008, "token已过期")
	ErrTokenNotEmpty          = errors.New(10020, "token不能为空")
	ErrPermissionDenied       = errors.New(10009, "权限不足")
	ErrInvalidParams          = errors.New(10010, "无效的参数")
	ErrRoleNotFound           = errors.New(10011, "角色不存在")
	ErrCasbinInitFailed       = errors.New(10012, "Casbin初始化失败")
	ErrCasbinLoadPolicyFailed = errors.New(10013, "Casbin加载策略失败")
	ErrCasbinGetPolicyFailed  = errors.New(10014, "Casbin获取策略失败")
	ErrDBInitFailed           = errors.New(10015, "数据库初始化失败")

	//
	ErrUsernameNotEmpty         = errors.New(10016, "用户名不能为空")
	ErrPasswordNotEmpty         = errors.New(10017, "密码不能为空")
	ErrUsernameLengthInvalid    = errors.New(10018, "用户名长度必须在3-20之间")
	ErrPasswordLengthInvalid    = errors.New(10019, "密码长度必须在6-32之间")
	ErrUserIdInvalid            = errors.New(10025, "用户ID无效")
	ErrRoleIdInvalid            = errors.New(10026, "角色ID无效")
	ErrOldPasswordNotEmpty      = errors.New(10021, "旧密码不能为空")
	ErrNewPasswordNotEmpty      = errors.New(10022, "新密码不能为空")
	ErrNewPasswordLengthInvalid = errors.New(10023, "新密码长度必须在6-32之间")
	ErrNewPasswordSameAsOld     = errors.New(10024, "新密码不能与旧密码相同")
	ErrRoleNameNotEmpty         = errors.New(10027, "角色名称不能为空")
	ErrRoleNameLengthInvalid    = errors.New(10028, "角色名称长度必须在2-50之间")

	ErrRoleNameExists       = errors.New(10029, "角色名称已存在")
	ErrRoleDefaultNotDelete = errors.New(10030, "系统默认角色不允许删除")

	ErrObjNotEmpty = errors.New(10031, "资源不能为空")
	ErrActNotEmpty = errors.New(10032, "操作不能为空")

	ErrPasswordEncryptFailed      = errors.New(10033, "密码加密失败")
	ErrCreateUserFailed           = errors.New(10034, "创建用户失败")
	ErrBindUserRoleFailed         = errors.New(10035, "用户角色绑定失败")
	ErrPermissionCheckFailed      = errors.New(10036, "权限检查失败")
	ErrCreateUserPermissionDenied = errors.New(10037, "无创建用户权限")
	ErrFindPageFailed             = errors.New(10038, "分页查询失败")
	ErrListUsersPermissionDenied  = errors.New(10039, "无查询用户列表权限")
)
